#include <bits/stdc++.h>

using namespace std;
int fa[1000], selct[1000], is1[1000], is2[1000];

int find(int x) {
    if (fa[x] == x)
        return x;
    return fa[x] = find(fa[x]);
}

void add(int x, int y) {
    x = find(x);
    y = find(y);
    fa[x] = y;
}

struct Node {
    int v, x, y;
};
Node e[1000];

void solve(int n, int L, int R, int a, int b) {
    int k = 0, ii, jj;
    bool flag = false;
    for (int i = 0; i < n; i++) {
        if (e[i].v >= L && e[i].v <= R) {
            selct[k] = i;
            fa[k] = k;
            k++;
        }
    }
    for (int i = 0; i < k; i++) {
        is1[i] = 0;
        is2[i] = 0;
    }
    for (int i = 0; i < k; i++)
        for (int j = 0; j < i; j++) {
            ii = selct[i], jj = selct[j];
            if (e[jj].y >= e[ii].y && e[ii].y + 1 >= e[jj].x) {
                add(i, j);
            } else if (e[ii].y >= e[jj].y && e[jj].y + 1 >= e[ii].x) {
                add(i, j);
            }
        }
    for (int i = 0; i < k; i++) {
        if (e[selct[i]].x <= a)is1[find(i)] = 1;
        if (e[selct[i]].y >= b)is2[find(i)] = 1;
    }
    for (int i = 0; i < k; i++) {
        if (is1[i] == 1 && is2[i] == 1)flag = true;
    }
    if (flag)cout << "Yes" << endl;
    else cout << "No" << endl;
//	cout<< (flag ? "Yes\n" : "No\n");
}

int main() {
    int n, Q, L, R, a, b;
    while (cin >> n) {
        for (int i = 0; i < n; i++) {
            cin >> e[i].v >> e[i].x >> e[i].y;
        }
        cin >> Q;
        while (Q--) {
            cin >> L >> R >> a >> b;
            solve(n, L, R, a, b);
        }
    }
    return 0;
}